import Net from '@/components/common/data/Net.js';
import Config from '@/components/common/data/Config.js';
export default class Cart {
  static getDemo (paras) {
    let url = Config.voucherUrl;
    console.log(paras);
    return Net.get(url, paras);
  }
  // 购物车操作得到，增加，删除
  static cart(type, method, data) {
    let url = Config.cart + '/' + type + '/' + method;
    return Net.newPost(url, data);
  }
  // 地址管理
  static address(type, data) {
    let url = Config.address + type;
    return Net.newPost(url, data);
  }
  // 退回余额支付
  static refund(type) {
    let url = Config.refund;
    return Net.newPost(url, type);
  }
  // 创建订单
  static create(data) {
    let url = Config.create;
    return Net.newPost(url, data);
  }
  // 获得支付方式
  static getpayOption(data) {
    let url = Config.payOption;
    return Net.newPost(url, data);
  }
  // 获得支付凭证
  static getOrder(data) {
    let url = Config.payOrder;
    return Net.newPost(url, data);
  }
  // 支付请求参数
  static getPay(id, pwd) {
    let url = Config.getPay + id;
    return Net.newPost(url, pwd);
  }
  // 微信支付是否成功
  static isPay(id) {
    let url = Config.isPay;
    return Net.newPost(url, id);
  }
  // 地址信息
  static area() {
    let url = Config.area;
    return Net.newPost(url);
  }
  static getapplyLevel() {
    let url = Config.applyLevel;
    return Net.get(url);
  }
  static getCartOid(paras) {
    return Net.newPost(Config.urlCartOid, paras);
  }
}
